//
//  DeleteHistoryTask.m
//  ZooNgonDoiOS
//
//  Created by Anh Jun Linh Tinh on 6/26/12.
//  Copyright (c) 2012 Personal. All rights reserved.
//

#import "DeleteHistoryTask.h"
#import "RKRequest.h"

@implementation DeleteHistoryTask
-(id)initWithHistoryId:(NSString *)historyId{
    self = [super init];
    if(self){
        _historyId = historyId; 
    }
    return self;
}

-(void)doExecute{
    NSDictionary *params = [NSDictionary dictionaryWithKeysAndObjects:@"history_id",_historyId,nil];
    [[RKObjectManager sharedManager].client delete:@"/history" usingBlock:^(RKRequest *request){
        request.params = params;
        request.delegate = self;
    }];
}

-(void)request:(RKRequest *)request didFailLoadWithError:(NSError *)error{
    NSLog(@"cde %@",[request.response bodyAsString]);
}
-(void)request:(RKRequest *)request didLoadResponse:(RKResponse *)response{
    NSLog(@"xxxxxxxxxxx %@",[response bodyAsString]);
}
@end
